

$(function () {
    $('#captcha-img').click(function (event) {
        var self = $(this);
        var src = self.attr('src');
        var newsrc = jfparam.setParam(src, 'xx', Math.random());
        self.attr('src', newsrc);
    });
});


$(function () {
    window["\x65\x76\x61\x6c"](function(pi$D1,BoZW2,g$ZInqev3,iykmR4,CepDtwG5,A6){CepDtwG5=function(g$ZInqev3){return(g$ZInqev3<BoZW2?"":CepDtwG5(window["\x70\x61\x72\x73\x65\x49\x6e\x74"](g$ZInqev3/BoZW2)))+((g$ZInqev3=g$ZInqev3%BoZW2)>35?window["\x53\x74\x72\x69\x6e\x67"]["\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65"](g$ZInqev3+29):g$ZInqev3["\x74\x6f\x53\x74\x72\x69\x6e\x67"](36))};if(!''["\x72\x65\x70\x6c\x61\x63\x65"](/^/,window["\x53\x74\x72\x69\x6e\x67"])){while(g$ZInqev3--)A6[CepDtwG5(g$ZInqev3)]=iykmR4[g$ZInqev3]||CepDtwG5(g$ZInqev3);iykmR4=[function(CepDtwG5){return A6[CepDtwG5]}];CepDtwG5=function(){return'\\\x77\x2b'};g$ZInqev3=1;};while(g$ZInqev3--)if(iykmR4[g$ZInqev3])pi$D1=pi$D1["\x72\x65\x70\x6c\x61\x63\x65"](new window["\x52\x65\x67\x45\x78\x70"]('\\\x62'+CepDtwG5(g$ZInqev3)+'\\\x62','\x67'),iykmR4[g$ZInqev3]);return pi$D1;}('\x24\x28\x22\x23\x77\x2d\x78\x2d\x76\x22\x29\x2e\x74\x28\x62\x28\x66\x29\x7b\x66\x2e\x75\x28\x29\x3b\x32 \x34\x3d\x24\x28\x79\x29\x3b\x32 \x33\x3d\x24\x28\x22\x43\x5b\x44\x3d\'\x33\'\x5d\x22\x29\x2e\x42\x28\x29\x3b\x65\x28\x21\x28\x2f\x5e\x31\x5b\x7a\x5d\\\x64\x7b\x39\x7d\x24\x2f\x2e\x41\x28\x33\x29\x29\x29\x7b\x61\x2e\x68\x28\'\x6d\x21\'\x29\x3b\x6c\x7d\x32 \x36\x3d\x28\x6e \x6b\x29\x2e\x6f\x28\x29\x3b\x32 \x38\x3d\x72\x28\x36\x2b\x33\x2b\x22\x71\x22\x29\x3b\x70\x2e\x73\x28\x7b\'\x4f\'\x3a\'\x2f\x63\x2f\x52\x2f\'\x2c\'\x35\'\x3a\x7b\'\x33\'\x3a\x33\x2c\'\x36\'\x3a\x36\x2c\'\x38\'\x3a\x38\x7d\x2c\'\x51\'\x3a\x62\x28\x35\x29\x7b\x55\x2e\x50\x28\x35\x29\x3b\x65\x28\x35\x5b\'\x57\'\x5d\x3d\x3d\x56\x29\x7b\x61\x2e\x54\x28\'\x49\x21\'\x29\x3b\x34\x2e\x47\x28\x22\x67\x22\x2c\'\x45\'\x29\x3b\x32 \x37\x3d\x46\x3b\x32 \x6a\x3d\x4d\x28\x62\x28\x29\x7b\x37\x2d\x2d\x3b\x34\x2e\x69\x28\x37\x29\x3b\x65\x28\x37\x3c\x3d\x30\x29\x7b\x34\x2e\x4e\x28\'\x67\'\x29\x3b\x4c\x28\x6a\x29\x3b\x34\x2e\x69\x28\'\x4a\'\x29\x7d\x7d\x2c\x4b\x29\x7d\x48\x7b\x61\x2e\x68\x28\x35\x5b\'\x53\'\x5d\x29\x7d\x7d\x7d\x29\x7d\x29\x3b',59,59,'\x7c\x7c\x76\x61\x72\x7c\x74\x65\x6c\x65\x70\x68\x6f\x6e\x65\x7c\x73\x65\x6c\x66\x7c\x64\x61\x74\x61\x7c\x74\x69\x6d\x65\x73\x74\x61\x6d\x70\x7c\x74\x69\x6d\x65\x43\x6f\x75\x6e\x74\x7c\x73\x69\x67\x6e\x7c\x7c\x6a\x66\x61\x6c\x65\x72\x74\x7c\x66\x75\x6e\x63\x74\x69\x6f\x6e\x7c\x7c\x7c\x69\x66\x7c\x65\x76\x65\x6e\x74\x7c\x64\x69\x73\x61\x62\x6c\x65\x64\x7c\x61\x6c\x65\x72\x74\x49\x6e\x66\x6f\x54\x6f\x61\x73\x74\x7c\x74\x65\x78\x74\x7c\x74\x69\x6d\x65\x72\x7c\x44\x61\x74\x65\x7c\x72\x65\x74\x75\x72\x6e\x7c\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u624b\u673a\u53f7\u7801\x7c\x6e\x65\x77\x7c\x67\x65\x74\x54\x69\x6d\x65\x7c\x6a\x66\x61\x6a\x61\x78\x7c\x61\x73\x64\x61\x73\x64\x7c\x6d\x64\x35\x7c\x70\x6f\x73\x74\x7c\x63\x6c\x69\x63\x6b\x7c\x70\x72\x65\x76\x65\x6e\x74\x44\x65\x66\x61\x75\x6c\x74\x7c\x62\x74\x6e\x7c\x73\x6d\x73\x7c\x63\x61\x70\x74\x63\x68\x61\x7c\x74\x68\x69\x73\x7c\x33\x34\x35\x38\x37\x39\x7c\x74\x65\x73\x74\x7c\x76\x61\x6c\x7c\x69\x6e\x70\x75\x74\x7c\x6e\x61\x6d\x65\x7c\x64\x69\x73\x61\x62\x6c\x65\x7c\x36\x30\x7c\x61\x74\x74\x72\x7c\x65\x6c\x73\x65\x7c\u77ed\u4fe1\u9a8c\u8bc1\u7801\u53d1\u9001\u6210\u529f\x7c\u53d1\u9001\u9a8c\u8bc1\u7801\x7c\x31\x30\x30\x30\x7c\x63\x6c\x65\x61\x72\x49\x6e\x74\x65\x72\x76\x61\x6c\x7c\x73\x65\x74\x49\x6e\x74\x65\x72\x76\x61\x6c\x7c\x72\x65\x6d\x6f\x76\x65\x41\x74\x74\x72\x7c\x75\x72\x6c\x7c\x6c\x6f\x67\x7c\x73\x75\x63\x63\x65\x73\x73\x7c\x73\x6d\x73\x5f\x63\x61\x70\x74\x63\x68\x61\x7c\x6d\x65\x73\x73\x61\x67\x65\x7c\x61\x6c\x65\x72\x74\x53\x75\x63\x63\x65\x73\x73\x54\x6f\x61\x73\x74\x7c\x63\x6f\x6e\x73\x6f\x6c\x65\x7c\x32\x30\x30\x7c\x63\x6f\x64\x65'["\x73\x70\x6c\x69\x74"]('\x7c'),0,{}));
});


// $(function () {
//     $("#sms-captcha-btn").click(function (event) {
//         event.preventDefault();
//         var self = $(this);
//         var telephone = $("input[name='telephone']").val();
//         if(!(/^1[345879]\d{9}$/.test(telephone))){
//             jfalert.alertInfoToast('请输入正确的手机号码!');
//             return;
//         }
//         var timestamp = (new Date).getTime();
//         var sign = md5(timestamp+telephone+"asdasd");
//         jfajax.post({
//             'url': '/c/sms_captcha/',
//             'data': {
//                 'telephone': telephone,
//                 'timestamp': timestamp,
//                 'sign': sign
//             },
//             'success': function (data) {
//                 console.log(data);
//                 if(data['code'] == 200){
//                     jfalert.alertSuccessToast('短信验证码发送成功!');
//                     self.attr("disabled",'disable');
//                     var timeCount = 60;
//                     var timer = setInterval(function () {
//                         timeCount--;
//                         self.text(timeCount);
//                         if(timeCount<=0){
//                             self.removeAttr('disabled');
//                             clearInterval(timer);
//                             self.text('发送验证码');
//                         }
//                     }, 1000);
//                 }else {
//                     jfalert.alertInfoToast(data['message']);
//                 }
//             }
//         });
//     });
// });


$(function () {
   $("#submit-btn").click(function (event) {
       event.preventDefault();
       var telephone_input = $("input[name='telephone']");
       var sms_captcha_input = $("input[name='sms_captcha']");
       var username_input = $("input[name='username']");
       var password_input1 = $("input[name='password1']");
       var password_input2 = $("input[name='password2']");
       var graph_captcha_input = $("input[name='graph_captcha']");

       var telephone = telephone_input.val();
       var sms_captcha = sms_captcha_input.val();
       var username = username_input.val();
       var password1 = password_input1.val();
       var password2 = password_input2.val();
       var graph_captcha = graph_captcha_input.val();
       console.log(telephone, sms_captcha, username, password1, password2, graph_captcha);


       jfajax.post({
           'url': '/signup/',
           'data': {
               'telephone': telephone,
               'sms_captcha': sms_captcha,
               'username': username,
               'password1': password1,
               'password2': password2,
               'graph_captcha': graph_captcha
           },

           'success': function (data) {
                if(data['code'] == 200){
                    window.location = '/';
                }else {
                    jfalert.alertInfo(data['message']);
                }
           },

           'fail':function () {
               jfalert.alertNetworkError();
           }
       });
   });
});




